﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyRapChieuPhim.DTO;
using QuanLyRapChieuPhim.BUS;
using QuanLyRapChieuPhim;

namespace QuanLyRapChieuPhim.GUI
{
    public partial class frmThongTinPhim : Form
    {
        public frmThongTinPhim()
        {
            InitializeComponent();
        }

        private static int m_Ma = -1;

        public static int Ma
        {
            get { return frmThongTinPhim.m_Ma; }
            set { frmThongTinPhim.m_Ma = value; }
        }

        private void frmThongTinPhim_Load(object sender, EventArgs e)
        {
            Location = new Point(50, 50);

            PhimDTO DTO = new PhimBUS().GetFromId(Ma);
            Text = DTO.TenPhim;
            txtTenPhim.Text = DTO.TenPhim;
            txtDinhDangPhim.Text = DTO.TenDinhDangPhim;
            txtTrangThaiPhim.Text = DTO.TenTrangThaiPhim;
            txtNamSanXuat.Text = DTO.NamSanXuat.ToString();
            txtHanSanXuat.Text = DTO.HangSanXuat;
            txtThoiLuongPhim.Text = DTO.ThoiLuongPhim.ToString();
            txtGioiThieuPhim.Text = DTO.GioiThieuPhim.Replace('\t',' ');
            ptbHinhAnhPhim.Image = new Bitmap("../../Images/" + DTO.Poster);
        }

        private void btnDienLai_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
